<template>
  <FormBox v-if="edit" ref="FormBox" :label="label">
    <div class="v-select" @click="click">
      <input :placeholder="placeholder" v-model="current" @change="change" />
      <i class="vicon arrow" :class="{'arrow_up':drop}">&#xe678;</i>
      <transition name="drop" appear>
        <ul v-show="drop">
          <slot />
        </ul>
      </transition>
    </div>
  </FormBox>
  <div v-else class="v-select-preview">
    <span class="v-select-preview-name">{{label}}：</span>
    <span>{{current || '-'}}</span>
  </div>
</template>

<script>
import mixing from "./mixing.js";
export default {
  name: "SelectEdit",
  extends: mixing,
  methods: {
    change() {
      this.$emit("input", this.input);
    },
  },
};
</script>